package com.tiger.qcu.service.impl;

import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.function.Function;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.tiger.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.tiger.qcu.mapper.NewsInfoMapper;
import com.tiger.qcu.domain.NewsInfo;
import com.tiger.qcu.service.INewsInfoService;
/**
 * 新闻信息Service业务层处理
 * 
 * @author jerry
 * @date 2025-07-07
 */
@Service
public class NewsInfoServiceImpl extends ServiceImpl<NewsInfoMapper, NewsInfo> implements INewsInfoService
{
    @Autowired
    private NewsInfoMapper newsInfoMapper;

    /**
     * 查询新闻信息
     * 
     * @param newsId 新闻信息主键
     * @return 新闻信息
     */
    @Override
    public NewsInfo selectNewsInfoByNewsId(Long newsId)
    {
        return newsInfoMapper.selectNewsInfoByNewsId(newsId);
    }

    /**
     * 查询新闻信息列表
     * 
     * @param newsInfo 新闻信息
     * @return 新闻信息
     */
    @Override
    public List<NewsInfo> selectNewsInfoList(NewsInfo newsInfo)
    {
        return newsInfoMapper.selectNewsInfoList(newsInfo);
    }

    /**
     * 新增新闻信息
     * 
     * @param newsInfo 新闻信息
     * @return 结果
     */
    @Override
    public int insertNewsInfo(NewsInfo newsInfo)
    {
        newsInfo.setCreateTime(DateUtils.getNowDate());
        return newsInfoMapper.insertNewsInfo(newsInfo);
    }

    /**
     * 修改新闻信息
     * 
     * @param newsInfo 新闻信息
     * @return 结果
     */
    @Override
    public int updateNewsInfo(NewsInfo newsInfo)
    {
        newsInfo.setUpdateTime(DateUtils.getNowDate());
        return newsInfoMapper.updateNewsInfo(newsInfo);
    }

    /**
     * 批量删除新闻信息
     * 
     * @param newsIds 需要删除的新闻信息主键
     * @return 结果
     */
    @Override
    public int deleteNewsInfoByNewsIds(Long[] newsIds)
    {
        return newsInfoMapper.deleteNewsInfoByNewsIds(newsIds);
    }

    /**
     * 删除新闻信息信息
     * 
     * @param newsId 新闻信息主键
     * @return 结果
     */
    @Override
    public int deleteNewsInfoByNewsId(Long newsId)
    {
        return newsInfoMapper.deleteNewsInfoByNewsId(newsId);
    }

    @Override
    public boolean saveBatch(Collection<NewsInfo> entityList, int batchSize) {
        return false;
    }

    @Override
    public boolean saveOrUpdateBatch(Collection<NewsInfo> entityList, int batchSize) {
        return false;
    }

    @Override
    public boolean updateBatchById(Collection<NewsInfo> entityList, int batchSize) {
        return false;
    }

    @Override
    public boolean saveOrUpdate(NewsInfo entity) {
        return false;
    }

    @Override
    public NewsInfo getOne(Wrapper<NewsInfo> queryWrapper, boolean throwEx) {
        return null;
    }

    @Override
    public Map<String, Object> getMap(Wrapper<NewsInfo> queryWrapper) {
        return null;
    }

    @Override
    public <V> V getObj(Wrapper<NewsInfo> queryWrapper, Function<? super Object, V> mapper) {
        return null;
    }

    @Override
    public NewsInfoMapper getBaseMapper() {
        return null;
    }
}
